package com.yugao.fintech.antelope.filepreview.service.impl;

import com.yugao.fintech.antelope.filepreview.model.FileAttribute;
import com.yugao.fintech.antelope.filepreview.model.FilePreviewRS;
import com.yugao.fintech.antelope.filepreview.service.FilePreview;
import org.springframework.stereotype.Service;
import org.springframework.ui.Model;

@Service
public class XmlFilePreviewImpl implements FilePreview {
    private final SimTextFilePreviewImpl simTextFilePreview;

    public XmlFilePreviewImpl(SimTextFilePreviewImpl simTextFilePreview) {
        this.simTextFilePreview = simTextFilePreview;
    }

    @Override
    public FilePreviewRS filePreviewHandle(String url, Model model, FileAttribute fileAttribute) {
        simTextFilePreview.filePreviewHandle(url, model, fileAttribute);
        return FilePreviewRS.builder().type(XML_FILE_PREVIEW_PAGE).build();
    }
}
